package edu.chinasoft.handler;

import edu.chinasoft.util.Dom4jUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller("handler01")
@RequestMapping("/handler01")
public class Handler01 {

    @RequestMapping("/method01.do")
    @ResponseBody
    public List<String> method01(HttpServletRequest request){
        //调用xml工具类解析xml文件返回list
        //获取配置文件的路径
        String xmpPath = request.getRealPath("/config/flow.xml");
        //获取配置文件中的请假工作流
        List<String> content = Dom4jUtil.getContent(xmpPath);
        return content;
    }
}
